package net.imwork.amorgemini.controller;

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * Created by lvbr on 2017-07-2616:22.
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Value("${customValue}")
    private Integer customValue;

    @GetMapping({"/hello", "/hi"})
    public String hello() {
        return "Hello Spring Boot! " + customValue;
    }

    @GetMapping({"/params{id}", "/params/{id}"})
    public String params(@PathVariable("id") Integer id) {
        return "id " + id;
    }

    @GetMapping({"/paramsKV"})
    public String paramsKV(@RequestParam("id") Integer _id) {
        return "id " + _id;
    }

    @GetMapping({"/paramsKVdefaultV"})
    public String paramsKVdefaultV(@RequestParam(value = "id", defaultValue = "666") Integer _id) {
        return "id " + _id;
    }
}
